<template>
  <div id="note-editor">
    <textarea class="form-contorl" cols="30" rows="10" v-model="activeNote.text"  @input="editorNote"></textarea>
  </div>
</template>

<script>
import {mapGetters, mapActions} from 'vuex'
export default {
  name: 'Editor',
  computed: {
    ...mapGetters([
      'activeNote'
    ])
    // activeNoteText() {return this.$store.getters.activeNote.text}
  },
  // methods: {
  //   ...mapActions([
  //     'editNote'
  //   ])
  // },
  methods: {
  	editorNote(e) {this.$store.dispatch('editNote', e.target.value)}
  },
  created() {
    console.log(this.activeNote)
  }
}
</script>

<style>
  #note-editor {
  height: 100%;
  margin-left: 380px;
}

#note-editor textarea {
  height: 100%;
  border: 0;
  border-radius: 0;
}
</style>
